﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Objects;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using DevExpress.Xpf.Charts;
using DevExpress.XtraCharts;
using DevExpress.XtraCharts.GLGraphics;
using Microsoft.Research.DynamicDataDisplay.DataSources;
using Microsoft.Win32;
using System.Linq;
using NeuroForecast.Properties.DataSources;
using ScaleType = DevExpress.XtraCharts.ScaleType;
using SeriesPoint = DevExpress.Xpf.Charts.SeriesPoint;
using Microsoft.Research.DynamicDataDisplay;
using Series = DevExpress.XtraCharts.Series;
using NeuronDotNet.Core;
using NeuronDotNet.Core.Backpropagation;
using NeuronDotNet.Core.Initializers;

namespace NeuroForecast
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow: Window
    {
        MSSQLTools DataBase = new MSSQLTools();
        BackpropagationNetwork Network;
        DataTable SData = new DataTable();
        DataTable RData = new DataTable();

        public MainWindow()
        {
            InitializeComponent();
            ProgressCtrl.SetValue(Panel.ZIndexProperty, 0);
        }

        public string ConvertDate(DateTime dateTime)
        {
            return dateTime.Month.ToString() + '-' + dateTime.Day.ToString() + '-' + dateTime.Year.ToString() + ' ' +
                   dateTime.Hour.ToString() + ':' + dateTime.Minute.ToString() + ':' + dateTime.Second.ToString();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DataBase.Connect())
                statusBar1.Items[0] = "Connected";
            else statusBar1.Items[0] = "Some error was occured during connecting";

            AddDateColumn();
            FillSourceList();
            RefreshDataGrid();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            DataBase.Disconnect();
        }

        public class DataForChart
        {
          public double StepValue {get; set;} // Значение по Х
          public int DurationValue {get; set;} // Значение по Y (в минутах)
        }


    }
}

